package com.reuters.rfa.example.omm.domainServer;

import com.reuters.rfa.common.Token;
import com.reuters.rfa.example.framework.prov.ProvDomainMgr;
import com.reuters.rfa.omm.OMMMsg;

/**
 * DataGenerator is an interface class for creating new stream items and
 * generating data for those stream items.
 * 
 * The generated data is called OrderEntry. This OrderEntry contains specific
 * information for each Reuters Domain Model data.
 * 
 */
public interface DataGenerator
{

    /**
     * Generates initial data.
     * 
     * @return Object[] array of initial OrderEntry
     */
    Object[] getInitialEntries();

    /**
     * Returns the next OrderEntries for update message. The new OrderEntries
     * are generated by calling {@link #generateUpdatedEntries()}.
     * 
     * @return Object[] array of OrderEntry
     */
    Object[] getNextEntries();

    /**
     * Generates the next OrderEntry for update message.
     * 
     */
    void generateUpdatedEntries();

    /**
     * Creates stream item for each message model type of RDMs.
     * 
     * @param mgr ProvDomainMgr
     * @param token request token
     * @param msg request OMM message
     * @return DataStreamItem the stream item for each domain
     */
    DataStreamItem createStreamItem(ProvDomainMgr mgr, Token token, OMMMsg msg);

}
